package com.indexingsystem.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.indexingsystem.boss.Vo.IdxThemeWordsSourceDeleVo;
import com.indexingsystem.boss.Vo.IdxThemeWordsSourceDetailReqVo;
import com.indexingsystem.boss.Vo.ThemeWordsSourceVo;
import com.indexingsystem.boss.admin.mapper.IdxThemeWordsSourceMapper;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.IdxThemeWordsSource;
import com.indexingsystem.boss.utils.BeanUtils;
import com.indexingsystem.system.service.IdxThemeWordsSourceService;

@Service
public class IdxThemeWordsSourceServiceImpl implements IdxThemeWordsSourceService {
	@Resource
	private IdxThemeWordsSourceMapper idxThemeWordsSourceMapper;

	@Override
	public int deleteByPrimaryKey(String id) {
		return idxThemeWordsSourceMapper.deleteByPrimaryKey( id );
	}

	@Override
	public int insert(IdxThemeWordsSource record) {
		return idxThemeWordsSourceMapper.insert( record );
	}

	@Override
	public int insertSelective(IdxThemeWordsSource record) {
		return idxThemeWordsSourceMapper.insert( record );
	}

	@Override
	public IdxThemeWordsSource selectByPrimaryKey(String id) {
		return idxThemeWordsSourceMapper.selectByPrimaryKey( id );
	}

	@Override
	public int updateByPrimaryKeySelective(IdxThemeWordsSource record) {
		return idxThemeWordsSourceMapper.updateByPrimaryKeySelective( record );
	}

	@Override
	public int updateByPrimaryKeyWithBLOBs(IdxThemeWordsSource record) {
		return idxThemeWordsSourceMapper.updateByPrimaryKeyWithBLOBs( record );
	}

	@Override
	public int updateByPrimaryKey(IdxThemeWordsSource record) {
		return idxThemeWordsSourceMapper.updateByPrimaryKey( record );
	}

	@Override
	public List<ThemeWordsSourceVo> selectIdxThemeSourceById(Integer themeWordId) {
		return idxThemeWordsSourceMapper.selectIdxThemeSourceById( themeWordId );
	}

	@Override
	public Integer deleteThemeWordsSource(IdxThemeWordsSourceDeleVo idxThemeWordsSourceDeleVo) {
		return idxThemeWordsSourceMapper.deleteThemeWordsSource(idxThemeWordsSourceDeleVo );
	}

	@Override
	public PagedResult<IdxThemeWordsSource> selectIdxThemeWordsSourceDetail(
			IdxThemeWordsSourceDetailReqVo idxThemeWordsSourceDetailReqVo) {
		// TODO Auto-generated method stub
		 Integer pageNo = idxThemeWordsSourceDetailReqVo.getPageNo() == null ? 1 : idxThemeWordsSourceDetailReqVo.getPageNo();
        Integer pageSize = idxThemeWordsSourceDetailReqVo.getPageSize() == null ? 10 : idxThemeWordsSourceDetailReqVo.getPageSize();
        // startPage是告诉拦截器说我要开始分页了。分页参数是这两个。
        PageHelper.startPage( pageNo, pageSize );
        return BeanUtils.toPagedResult( idxThemeWordsSourceMapper.selectIdxThemeWordsSourceDetail( idxThemeWordsSourceDetailReqVo ) );
	}

	@Override
	public Integer selectIdxThemeWordsSourceDetailCount(IdxThemeWordsSourceDetailReqVo idxThemeWordsSourceDetailReqVo) {
		// TODO Auto-generated method stub
		return idxThemeWordsSourceMapper.selectIdxThemeWordsSourceDetailCount(idxThemeWordsSourceDetailReqVo);
	}

}
